﻿<template>
  <div class="index_container">
    <div class="index_header new_header clearfix" style="background-color: rgba(0,0,0,0)">
      <img src="../../static/img/letter_box_index.png" class="btn_base">
      <img src="../../static/img/mission.png" alt="" class="btn_base">
      <img src="../../static/img/certain_btn_index.png" class="certain_btn_index" v-on:click="$goto('')">
    </div>
    <div class="index_main clearfix" style="height:init">
      <div class="middle_index_main ">
        <img src="../../static/img/ad_icon_index.png" alt="" v-on:click="$goto()">
        <div class="clearfix">
          <img src="../../static/img/get_address_index.png" alt="">
          <img src="../../static/img/stud_index.png" alt="">
        </div>
      </div>
      <!--<div class="door_red">-->
        <!--<img src="../../static/img/door_red.png" alt="Alternate Text" class="door_base" v-on:click="ad_van_t_f" />-->
        <!--<p class="door_w">-->
          <!--披荆斩棘 只为遇见你-->
        <!--</p>-->
      <!--</div>-->
      <!--<div class="door_blue">-->
        <!--<img src="../../static/img/door_blue.png" alt="Alternate Text" class="door_base" />-->
        <!--<p class="door_w">-->
          <!--救助与支援-->
        <!--</p>-->
      <!--</div>-->
      <!--<div class="door_green" v-on:click="door_green">-->
        <!--<img src="../../static/img/door_green.png" alt="Alternate Text" class="door_base" />-->
        <!--<p class="door_w">-->
          <!--随风而动 随缘而遇-->
        <!--</p>-->
      <!--</div>-->
      <!--<img src="../../static/img/app_index_letter.png" class="app_index_letter"/>-->
      <!--<img src="../../static/img/new_letter_index.png" class="letter_man_e" v-on:click="letter_man_e">-->
      <img src="../../static/img/caoc.png" class="caoc_c"/>
    </div>
    <router-view>
    </router-view>
    <day_mission v-show="day_mission_Data"></day_mission>
    <first_view  @close="close" v-show="first_view_show"></first_view>
    <FootM></FootM>
   </div>
</template>
<script>
  import '../../static/css/reset.css';
  import MintUI from 'mint-ui';
  import Vue from "vue";
  import '../../static/css/mint-ui/style.css';
  import "../../static/css/index/index_app.css";
  import useRem from '../../static/js/use_rem.js';
  import FootM from "./FooterMenu.vue";
  import common from "../common/common.js";
  import qs from 'qs';
  import axios from 'axios';
  import "../../static/css/new_style/new_style.css";
  import first_view from "./first_view.vue";
  import day_mission from "./day_mission.vue";
  axios.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8';
  Vue.prototype.$http = axios;
  Vue.use(MintUI);
  useRem();

export default {
  name: 'hello',
  data () {
    return {
      have_user_id: false,
      login_hidden_data:false,
      user_id:"",
      first_view_show:false,
      day_mission_Data:false,
//    website:"https://wx.yizhiweimeng.com/yizhiweimen/static",
    }
  },
  created:function(){
      //第一次登录
      let first_view_data = this.$store.getters.get_first_view;
      if(first_view_data.hide){
          this.$goto("/Day_m");
      }
  },
  mounted: function () {
    try{
        common.watch_err();
        let user_id = localStorage.getItem("user_loc_mes");
        //plus.navigator.setStatusBarStyle('light');
        this.user_id = user_id.id;
        //有user_id 就
        let temp = !!user_id.id;
        if (temp) {
          this.change_login_hidden_data();
        }
    }catch (e){
        console.log(e);
    }
    mui.plusReady(() => {
          //初始化时 固定底部
//        try {
//        } catch(e){
//        }
//      plus.navigator.setStatusBarBackground("#000");
      //关闭开始页面
//      plus.navigator.closeSplashscreen();
      let index_id = plus.webview.currentWebview().id;
      localStorage.setItem("index_id", index_id)
    });
    //ajax_base__s
    sessionStorage.setItem("ajax_base","http://wx.yizhiweimeng.com/");
    //添加login_change自定义事件监听
    window.addEventListener('login_change',()=>{
      //获得事件参数
      this.change_login_hidden_data();
    });
    //let user_id = localStorage.getItem("user_id");
  },
  methods: {
    letter_man_e:function () {
      common.jump({
        url:'./wish.html?user_id='+this.user_id,
        id:"new_html.html"
      })
    },
    go_wish:function () {
      common.jump({
        url:'./wish.html?user_id='+this.user_id,
        id:"new_html.html"
      })
    },
    close:function () {
      this.first_view_show = false;
    },
    ad_van_t_f:function () {
      common.jump({
        url:'./Adventure.html?user_id='+this.user_id+'#/Ad_user_index',
        id:"new_html.html"
      })
    },
    //door_green
    door_green:function () {
      let user_id = localStorage.getItem("user_id");
      //没有登陆的
      if(user_id == ""|| user_id ==null || user_id == undefined ) {
         Toast({
          message: "请先登陆",
          position: 'bottom',
          duration: 5000
         });
        return
      }
      common.jump({
          url:"./new_html.html?user_id="+user_id,
          id:"new_html.html"
      });
    },
    change_login_hidden_data: function () {
//      console.log("change_login_hidden_data");
      this.login_hidden_data = true;
      setTimeout(() => {
        this.login_hidden_data = true;
//        console.log(this.login_hidden_data)
      },0)
    },
    show_hide: function () {
      this.$store.dispatch("thom_redirect",
      {
          name: "/Wrap_certain_layer/Certain_layer_input", router: this.$router
      });
    },
    go_login: function () {
      if (this.login_hidden_data == true) return;
       mui.plusReady(function(){
//              console.log("当前页面URL："+plus.webview.currentWebview().getURL());
              mui.openWindow({
                url: "./app_login.html",
                id: "app_login",
                show: {
                  autoShow: true,//页面loaded事件发生后自动显示，默认为true
                  aniShow: 'slide-in-bottom',//页面显示动画，默认为”slide-in-right“；
                },
              });
       })
    },
    login: function () {
      if (this.login_hidden_data == true) return;
      mui.plusReady(function(){
//              console.log("当前页面URL："+plus.webview.currentWebview().getURL());
              mui.openWindow({
                url:"./app_login.html#/Wrap_login/Login",
                id: "app_login_log",
                show: {
                  autoShow: true,//页面loaded事件发生后自动显示，默认为true
                  aniShow: 'slide-in-bottom',//页面显示动画，默认为”slide-in-right“；
                },
              });
      })
    }
   },
  components: {
    FootM,
    first_view,
    day_mission
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
  @import "./scss/index.scss";
</style>
<style scoped>
  .index_W{
    width: 47vw;
    height: 27.2vw;
    position: absolute;
    bottom:35.4vw;
    left:14.4vw;
  }
  .caoc{
    width: 20.8vw;
    height: 16.2vw;
    display: block;
    position: absolute;
    left: 42vw;
    bottom:17vw;
  }
  .index_container{
    height: 100%;
    width: 100%;
    background-size:cover;
    background-image: url("../../static/img/new_index_bg.jpg");
  }
</style>
<style>
  /*index_headers*/
  .index_header{
    padding-top:2.3vw;
    display: block;
  }
  /*index_headere*/
  .login_hidden {
    opacity: 0;
  }
  * {
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
    user-select: none;
  }
  .letter_send_box p {
    margin-top: 11vw;
  }

  .wrap_user_img {
    width: 28vw;
    height: 28vw;
    border-radius: 50%;
    border: 2px solid #cc9966;
    margin: 0rem auto;
    background-color: #ffffff;
    margin-bottom: 0.5rem;
    position: relative;
  }
  .input_letter_id {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    color: #847f7f;
  }
  .wrap_letter_send_box {
    z-index: 2000;
    height: 110vw;
    width: 75%;
  }
  .letter_send_box{
    height:100%;
    width:100%;
    position:absolute;
    z-index:1000;
    top:0;
    left:0;
    background-color:rgba(0,0,0,0.6);
  }
</style>


